<?php namespace App;

use Illuminate\Database\Eloquent\Model;

/**
 * App\Vote
 *
 * @property integer $id
 * @property string $title
 * @property string $content
 * @property string $img_src
 * @property boolean $is_lock
 * @property integer $vote_count
 * @property integer $vote_project_id
 * @property integer $user_id
 * @property \Carbon\Carbon $created_at
 * @property \Carbon\Carbon $updated_at
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\VotePost[] $votePosts
 * @method static \Illuminate\Database\Query\Builder|\App\Vote whereId($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Vote whereTitle($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Vote whereContent($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Vote whereImgSrc($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Vote whereIsLock($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Vote whereVoteCount($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Vote whereVoteProjectId($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Vote whereUserId($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Vote whereCreatedAt($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Vote whereUpdatedAt($value)
 */
class Vote extends Model 
{
  protected $fillable = ['title', 'content', 'img_src'];

  protected $attributes = [
    'is_lock' => 0,
    'vote_count' => 0,
    'vote_project_id' => 0,
    'user_id' => 0,
  ];

  public function votePosts()
  {
    return $this->hasMany('App\VotePost');
  }
}
